home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / modula2 / 353 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.1 KB  |  50 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: cix.compulink.co.uk!usenet
  3. From: mark_tbu@cix.compulink.co.uk ("Mark Morgan Lloyd ")
  4. Subject: Re: xor procedure for M-2
  5. Message-ID: <DnFtME.7GA@cix.compulink.co.uk>
  6. Organization: KDG Mobrey Telemetry
  7. References: <francosky.1.1.3132950B@postbox.acs.ohio-state.edu>
  8. Date: Tue, 27 Feb 1996 14:01:25 GMT
  9. X-News-Software: Ameol
  10.  
  11. >       
  12. >       if someone could give me a simple way to write a program to 
  13. compute 
  14. > the value
  15. > of xors in modula2 it would be appreciated.\
  16. > like a function that returns the decimal value 26 for xor(12, 22)   
  17. > (12 xor 22)
  18. > later
  19. > send to emial
  20.  
  21. <sigh>
  22.  
  23. Article: 7435 of comp.lang.modula2
  24. Newsgroups: comp.lang.modula2
  25. Subject: Re: XOR function
  26. Organization: KDG Mobrey Telemetry
  27. References: <1996Feb8.114044.15072@ucl.ac.uk>
  28. X-News-Software: Ameol
  29.  
  30. MODULE Demo;
  31.  
  32. VAR     a, b, c: CARDINAL;
  33.  
  34. BEGIN
  35.   IF SIZE(CARDINAL) <> SIZE(BITSET) THEN        (* Paranoid? Me?        *)
  36.     UserBreak
  37.   END;
  38.   c:= CARDINAL(BITSET(a) / BITSET(b))
  39. END Demo.
  40.  
  41. Mark Morgan Lloyd
  42. mark_tbu@cix.compulink.co.uk
  43.  
  44. [Opinions above are the author's, not those of his employers or 
  45. colleagues]
  46.